.PHONY: clean index default

OBJ_FILES = main.o postgrefs.o config.o logger.o pool.o query.o

CC = g++
CFLAGS += -Wall
CFLAGS += $(shell pkg-config fuse --cflags)
CFLAGS += $(shell pkg-config libpqxx --cflags)

LDFLAGS += $(shell pkg-config fuse --libs)
LDFLAGS += $(shell pkg-config libpqxx --libs)
LDFLAGS += -O2

%.o : %.cpp
	$(CC) $(CFLAGS) -c $<

default: postgrefs

postgrefs: $(OBJ_FILES)
			$(CC) $(LDFLAGS) -o postgrefs $(OBJ_FILES)

clean:
	rm -f *.o 
	rm -f postgrefs 
	rm -f tags cscope.out

docs: ${OBJ_FILES} doxygen.conf
	doxygen doxygen.conf

index:
	ctags -R
	cscope -R . </dev/null
